# Contributor: fossdd <fossdd@pwned.life>
maintainer="fossdd <fossdd@pwned.life>"
pkgname=volk
pkgver=1.3.295
pkgrel=0
pkgdesc="Meta loader for Vulkan API"
url="https://github.com/zeux/volk"
arch="all"
license="MIT"
makedepends="
	cmake
	samurai
	vulkan-headers
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/zeux/volk/archive/refs/tags/$pkgver.tar.gz"
options="!check" # no tests

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DVOLK_INSTALL=ON \
		$crossopts
	cmake --build build
}

check() {
	ctest --test-dir build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
1e0b05f0a7aa9e185b4b7ef42d53c1a23ccb8511cd3c2821e8976c11130ea196a24612ca18319fc2c0ac99bc2b1d334fc62ea9863f45800007b9bc92978da665  volk-1.3.295.tar.gz
"
